var key0_object;
var key1_object;

function Start() {
	document.documentElement.addEventListener("keydown", keyHandler, false);
	key1_object = document.getElementById("key_1")
	if (key0_object = document.getElementById("key_0")) {
	key0_object = document.getElementById("key_0")
		key0_object.setAttribute("onclick", "emulate()");//function() {emulate();});
	}
}

function keyHandler(event) {
	//alert(event.toString);
}

function emulate() {
 	var o;
	if( window.KeyEvent )
	{
		o = document.createEvent('KeyEvents');
		o.initKeyEvent( "keydown", true, true, window, false, false, false, false, 13, 0 );
	} else {
		o = document.createEvent('UIEvents');	
		o.initUIEvent( "keydown", true, true, window, 1 );	
		o.keyCode = 13;	
	}
	if (!key0_object.dispatchEvent(o)) alert(o.keyCode);
	alert(o.key);
}